home *** CD-ROM | disk | FTP | other *** search
- /********************************************
- ; File: IntMath.h
- ;
- ;
- ; Copyright Apple Computer, Inc. 1986, 1987, 1988
- ; All Rights Reserved
- ;
- ********************************************/
-
- #ifndef __types__
- #include <types.h>
- #endif
-
- #ifndef __intmath__
- #define __intmath__
-
- #define imBadInptParam 0x0B01 /*error - bad input parameter */
- #define imIllegalChar 0x0B02 /*error - Illegal character in string */
- #define imOverflow 0x0B03 /*error - integer or long integer overflow */
- #define imStrOverflow 0x0B04 /*error - string overflow */
-
- #define minLongint 0x80000000 /*Limit - minimum negative signed long integer */
- #define minFrac 0x80000000 /*Limit - pinned value for negative Frac overflow */
- #define minFixed 0x80000000 /*Limit - pinned value for negative Fixed overflow */
- #define minInt 0x8000 /*Limit - minimum negative signed integer */
- #define maxInt 0x7FFF /*Limit - maximum positive signed integer */
- #define maxUInt 0xFFFF /*Limit - maximum unsigned integer */
- #define maxLongint 0x7FFFFFFF /*Limit - maximum positive signed Longint */
- #define maxFrac 0x7FFFFFFF /*Limit - pinned value for positive Frac overflow */
- #define maxFixed 0x7FFFFFFF /*Limit - pinned value for positive Fixed overflow */
- #define maxULong 0xFFFFFFFF /*Limit - maximum unsigned Long */
-
- #define unsignedFlag 0x0000 /*SignedFlag - */
- #define signedFlag 0x0001 /*SignedFlag - */
-
- typedef struct LongDivRec {
- Longint quotient; /* LongDivRec - Quotient from LongDiv*/
- Longint remainder; /* LongDivRec - remainder from LongDiv*/
- } LongDivRec, *LongDivRecPtr ;
-
- typedef LongDivRec DivRec; /* for compatibility w/previous releases */
-
- typedef struct LongMulRec {
- Longint lsResult; /* LongMulRec - Low Long of result*/
- Longint msResult; /* LongMulRec - High long of result*/
- } LongMulRec, *LongMulRecPtr ;
-
- typedef struct IntDivRec {
- Integer quotient; /* IntDivRec - quotient from SDivide*/
- Integer remainder; /* IntDivRec - remainder from SDivide*/
- } IntDivRec, *IntDivRecPtr ;
-
- typedef struct WordDivRec {
- Word quotient; /* WordDivRec - Quotient from UDivide*/
- Word remainder; /* WordDivRec - remainder from UDivide*/
- } WordDivRec, *WordDivRecPtr ;
-
- extern pascal void IMBootInit() inline(0x010B,dispatcher); /* Integer Math Tools */
- extern pascal void IMStartUp() inline(0x020B,dispatcher); /* Integer Math Tools */
- extern pascal void IMShutDown() inline(0x030B,dispatcher); /* Integer Math Tools */
- extern pascal Word IMVersion() inline(0x040B,dispatcher); /* Integer Math Tools */
- extern pascal void IMReset() inline(0x050B,dispatcher); /* Integer Math Tools */
- extern pascal Boolean IMStatus() inline(0x060B,dispatcher); /* Integer Math Tools */
-
- extern pascal Integer Dec2Int() inline(0x280B,dispatcher); /* Integer Math Tools */
- extern pascal Longint Dec2Long() inline(0x290B,dispatcher); /* Integer Math Tools */
- extern pascal Frac Fix2Frac() inline(0x1C0B,dispatcher); /* Integer Math Tools */
- extern pascal Longint Fix2Long() inline(0x1B0B,dispatcher); /* Integer Math Tools */
- extern pascal void Fix2X() inline(0x1E0B,dispatcher); /* Integer Math Tools */
- extern pascal Fixed FixATan2() inline(0x170B,dispatcher); /* Integer Math Tools */
- extern pascal Fixed FixDiv() inline(0x110B,dispatcher); /* Integer Math Tools */
- extern pascal Fixed FixMul() inline(0x0F0B,dispatcher); /* Integer Math Tools */
- extern pascal Fixed FixRatio() inline(0x0E0B,dispatcher); /* Integer Math Tools */
- extern pascal Integer FixRound() inline(0x130B,dispatcher); /* Integer Math Tools */
- extern pascal Fixed Frac2Fix() inline(0x1D0B,dispatcher); /* Integer Math Tools */
- extern pascal void Frac2X() inline(0x1F0B,dispatcher); /* Integer Math Tools */
- extern pascal Frac FracCos() inline(0x150B,dispatcher); /* Integer Math Tools */
- extern pascal Frac FracDiv() inline(0x120B,dispatcher); /* Integer Math Tools */
- extern pascal Frac FracMul() inline(0x100B,dispatcher); /* Integer Math Tools */
- extern pascal Frac FracSin() inline(0x160B,dispatcher); /* Integer Math Tools */
- extern pascal Frac FracSqrt() inline(0x140B,dispatcher); /* Integer Math Tools */
- extern pascal Word Hex2Int() inline(0x240B,dispatcher); /* Integer Math Tools */
- extern pascal LongWord Hex2Long() inline(0x250B,dispatcher); /* Integer Math Tools */
- extern pascal LongWord HexIt() inline(0x2A0B,dispatcher); /* Integer Math Tools */
- extern pascal Word HiWord() inline(0x180B,dispatcher); /* Integer Math Tools */
- extern pascal void Int2Dec() inline(0x260B,dispatcher); /* Integer Math Tools */
- extern pascal void Int2Hex() inline(0x220B,dispatcher); /* Integer Math Tools */
- extern pascal void Long2Dec() inline(0x270B,dispatcher); /* Integer Math Tools */
- extern pascal Fixed Long2Fix() inline(0x1A0B,dispatcher); /* Integer Math Tools */
- extern pascal void Long2Hex() inline(0x230B,dispatcher); /* Integer Math Tools */
- extern LongDivRec LongDivide();
- extern LongMulRec LongMul();
- extern pascal Word LoWord() inline(0x190B,dispatcher); /* Integer Math Tools */
- extern pascal Longint Multiply() inline(0x090B,dispatcher); /* Integer Math Tools */
- extern IntDivRec SDivide();
- extern WordDivRec UDivide();
- extern pascal Longint X2Fix() inline(0x200B,dispatcher); /* Integer Math Tools */
- extern pascal Longint X2Frac() inline(0x210B,dispatcher); /* Integer Math Tools */
-
- #endif
-